package yunquan.wang.modules.base.entity;

import java.util.HashSet;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import yunquan.wang.base.domain.IdEntity;

/**
 * 权限.
 * 权限和资源一对一，如BASE_SYSTEM_LIST。对应的Url为/base/system/list*
 */
@Entity
@Table(name = "base_authority")
public class Authority extends IdEntity {
	/**
	 * 
	 */
	private static final long serialVersionUID = 402510134125468707L;
	@Column(name = "name",length=30)
	private String name;
	@Column(name="authinfo",length=30)
	private String authinfo;
	@Column(name="authtype",length=20)
	private String authtype;
	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "authority")
    private Set<RolesAuthority> rolesAuthority=new HashSet<RolesAuthority>(0);
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getAuthinfo() {
		return authinfo;
	}
	public void setAuthinfo(String authinfo) {
		this.authinfo = authinfo;
	}
 
	public String getAuthtype() {
		return authtype;
	}
	public void setAuthtype(String authtype) {
		this.authtype = authtype;
	}
	public Set<RolesAuthority> getRolesAuthority() {
		return rolesAuthority;
	}
	public void setRolesAuthority(Set<RolesAuthority> rolesAuthority) {
		this.rolesAuthority = rolesAuthority;
	}
 
	
	
	
}
